package com.luban.procceesor;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;

/**
 * @Author gary <498982703@qq.com>
 * @Version V1.0.0
 * @Since 1.0
 * @Date 2020/10/27
 */
@Component
public class CsmdBeanPostProccessor implements BeanPostProcessor {

	@Override
	public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
		if (beanName.equals("user")) {
			System.out.println("实例化之前");
		}

		return null;


	}

	@Override
	public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
		if (beanName.equals("user")) {
			System.out.println("实例化之后");
		}

		return null;
	}
}
